package top.yihoxu.serializer;

import java.io.IOException;

/**
 * @Author dth
 * @Date 2024/5/21 15:02
 * @PackageName:top.yihoxu.serializer
 * @ClassName: Serializer
 * @Description: 序列化器接口
 * @Version 1.0
 */
public interface Serializer {
    /**
     * 序列化
     *
     * @param object
     * @param <T>
     * @return
     * @throws IOException
     */
    <T> byte[] serialize(T object) throws IOException;

    <T> T deserialize(byte[] bytes, Class<T> type) throws IOException;
}
